#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
//int main()
//{
//	int arr[3] = { 0,1,2 };
//	printf("%p\n", arr[0]);
//	printf("%p\n", arr[1]);
//	printf("%p\n", &arr[0] - &arr[1]);
//	printf("%d\n", &arr[0] - &arr[1]);
//	return 0;
//}

#include<stdio.h>
char* my_strstr(const char* str1, const char* str2)
{
	char* tmp1 = str1;
	char* tmp2 = str2;
	char* cp = tmp1;
	int num = strlen(str2);
	int i = 3;
	do
	{
		while(*tmp1 != *tmp2)
		{
			tmp1++;
		}
		cp = tmp1;
		while (*tmp2)
		{
			tmp1++;
			tmp2++;
			i++;
		}
		if (num == i)
		{
			return cp;
		}
		else
		{
			tmp1 = cp + 1;
			tmp2 = str2;
		}
	} while (*tmp1!=);
}
int main()
{
	char arr1[] = "abbbcdef";
	char arr2[] = "bbc";
	char* ret = my_strstr(arr1, arr2);
	printf("%s", ret);
	return 0;
}